#ifndef _1wire_h_
#define _1wire_h_

#include "type.h"

#define MATCH_ROM	0x55
#define SKIP_ROM	0xCC
#define	SEARCH_ROM	0xF0

#define CONVERT_T	0x44		// DS1820 commands
#define READ		0xBE
#define WRITE		0x4E
#define EE_WRITE	0x48
#define EE_RECALL	0xB8

#define	SEARCH_FIRST	0xFF		// start new search
#define	PRESENCE_ERR	0xFF
#define	DATA_ERR	0xFE
#define LAST_DEVICE	0x00		// last device found
//0x01 ... 0x40: continue searching

u08 w1_reset(u08 port_num);
void  w1_byte_wr( u08 port_num,u08 b );
u08 w1_byte_rd( u08 port_num );
u08 w1_rom_search( u08 port_num,u08 diff, u08  *id );


#endif
